<template>
  <div class="equipmentScrappingDetail" v-if="detailForm">
    <h4>报废信息</h4>
    <table class="table" border="1" rules="all">
      <tr>
        <td>申请时间</td>
        <td>{{detailForm.applicationTime}}</td>
        <td>申请人</td>
        <td>{{detailForm.sysUserName}}</td>
      </tr>
      <tr class="height">
        <td>备注</td>
        <td colspan="3">{{detailForm.scrapInfo}}</td>
      </tr>
    </table>
    <h4>设备信息</h4>
    <el-table :data="detailForm.deviceScrapDeviceDetailsDtoList" border>
      <el-table-column align="center" type="index" label="序号" width="55"/>
      <el-table-column label="设备编号" prop="deviceCode"/>
      <el-table-column label="设备名称" prop="deviceName"/>
      <el-table-column label="购置日期" prop="buyDate"/>
      <el-table-column label="预计报废日期" prop="expectedRetireDate"/>
      <el-table-column label="采购价格" prop="buyMoney"/>
      <el-table-column label="当前净值" prop="currentValue"/>
      <el-table-column label="报废原因" prop="remarksReason"/>
    </el-table>
    <h4>相关文件</h4>
    <div class="unloadBox" v-if="detailForm.deviceScrapEquipmentDocumentList.length>0">
      <div class="file" v-for="(item,index) in detailForm.deviceScrapEquipmentDocumentList">
        <span class="index">{{index+1}}、</span>
        <span class="blue">{{item.fileName}}</span>
      </div>
    </div>
  </div>
</template>

<script>
    import {deviceDes} from '@/api/scrap/index'
    export default {
        name: "equipmentScrappingDetail",
      data(){
          return{
            list:[],
            detailForm:null,
          }
      },
      created() {
        let id = this.$route.query.id
        deviceDes(id).then((res)=>{
          if(res.code==200){
            this.detailForm = res.data
          }
        })
      },
    }
</script>
<style scoped lang="scss">
  .equipmentScrappingDetail {
    margin-left:20px;
    width:900px;
    h4 {
      color: #05A380;
    }
    .fileList{
      border: 1px solid #cccccc;
      min-height: 50px;
      width:100%;
    }
    .table {
      width:100%;
      border: 1px solid #cccccc;
      color: #606266;
      font-size: inherit;
      .height {
        height: 120px;
      }
      tr {
        td:nth-child(2n-1) {
          width: 20%;
          text-align: center;
        }

        td:nth-child(2n) {
          width: 30%;
          padding-left: 10px;
        }

        td {
          line-height: 35px;

          .red {
            color: red;
          }
        }
      }
    }
  }
</style>
